<include file="header" />

<body class="guest-bg">
    <div class="wraper bottom-none">
        <div class="load">
            <img class="load-bee" src="/assets/base/repair/images/load-bee.png"/>

        </div>
        <a href="javascript:history.back(-1)" class="back"><img src="/assets/base/center/images/return.png"/></a>
        <div class="identity"><img src="/assets/base/center/images/guest.png"/></div>
        <div class="form-child clearfix">
            <span class="pull-left">姓名</span>
            <input class="pull-left" placeholder="请输入您的真实姓名" id="username" value="{BEESCRM:$user.real_name}">
        </div>
        <div class="form-child clearfix">
            <span class="pull-left">手机</span>
            <input class="pull-left" placeholder="请输入您的手机号码" id="mobile" value="{BEESCRM:$user.mobile}">
            <input type="hidden" id="register_id" value="{BEESCRM:$user.user_id}">
        </div>
        <a href="#" class="register-btn"><img src="/assets/base/center/images/btn.png"/></a>
        <if condition="$remark">
            <include file="remark"/>
        </if>
        <div class="bottom-box">
            <p class="copyright">杭州青橄榄网络技术有限公司 技术支持</p>
        </div>
    </div>

<include file="commonJS" />
<script>
    var height = $(window).height();
    var bottombox_height = $('.bottom-box').outerHeight();
    $('.wraper').css("minHeight", height);
    $('.wraper').css("paddingBottom", bottombox_height);

    $(function () {
        $('.register-btn').click(function () {
            var data = {};
            var verify_method = /^(?:13\d|15\d|18\d|17\d|14\d)\d{5}(\d{3}|\*{3})$/;
            data.real_name = $('#username').val();
            data.mobile = $('#mobile').val();
            data.register_id = $('#register_id').val();
            data.type = 2;
            if (!data.real_name) {
                $.alert('error', '请输入姓名');
                return false;
            }
            if (!verify_method.test(data.mobile)) {
                $.alert('error', '请填写正确的手机号');
                return false;
            }
            var json = {};
            json.method = 'post';
            json.type = 'json';
            json.url = "{BEESCRM::U('/base/User/doRegister',array('account_id'=>$accountId ,'type' =>2))}";
            json.data = data;
            $.getAjax(json, true, reload, '');
        });
        function reload(data) {
            var type = data.type;
            location.href = "{BEESCRM::U('/base/User/tips',array('account_id'=>$accountId))}/type/"+type;
            //setTimeout("location.href ='{BEESCRM::U('base/center/center',array('wechat_id'=>$wechat_id))}'", 2000);
        }
    })
</script>
</body>
</html>